import qs from "qs"
//统一管理接口地址
import request from "./request.js";
export const JingPinAPI = () => request.get("/products/recommend");
export const ReMenAPI = () => request.get("/products/hot")

//商品详情
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`)
//获取用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles")
export const SendSMSAPI = (params) => request.post("/sendSMS", qs.stringify(params))

export const PhoneReginAPI = (params) => request.post("/phoneRegin", qs.stringify(params))

//微信扫码登录 
export const WeiXinLoginAPI = (params) => request.post("/wechatUsers/PCLogin", qs.stringify(params));

//绑定手机
export const BingdingWeixinAPI = (params) => request.post(`/wechatUsers/binding`, qs.stringify(params));

//加入购物车
export const addToCartAPI = (params) => request.post("/shop/carts/add", qs.stringify(params))

//获取全部商品,按需获取商品
//获取用户信息
export const GetProductsAPI = (params) => request.get("/products", { params })


//查看购物车
export const ShopCartssAPI = () => request.get("/shop/carts");

//删除商品
export const DeleteShopCartssAPI = (params) => request.delete(`/shop/carts?productIds=${params}`);